home *** CD-ROM | disk | FTP | other *** search
/ Tux Racer / Tux Racer.iso / program files / Sunspire Studios / Tux Racer / courses / common / courseinit.tcl < prev    next >
Encoding:
Text File  |  2001-09-13  |  1.4 KB  |  65 lines

  1. # Course initialization script
  2. # Sets basic course paramaters before the lighting is set.
  3.  
  4. set cwd [pwd]
  5.  
  6. # Extract cup directory
  7. if { ![regexp {^(.*)/[^/]*/?} $cwd dummy cup_dir] } {
  8.     tux_warning "Couldn't determine cup directory"
  9.  
  10.     set cup_dir "$tux_data_dir/courses"
  11. }
  12.  
  13. tux_goto_data_dir
  14.  
  15. cd courses/common
  16.  
  17. #
  18. # Lighting
  19. #
  20. set conditions [tux_get_race_conditions]
  21. if { $conditions == "sunny" } {
  22.     source $cup_dir/sunny_light.tcl
  23. } elseif { $conditions == "cloudy" } {
  24.     source $cup_dir/foggy_light.tcl
  25. } elseif { $conditions == "night" } {
  26.     source $cup_dir/sunset_light.tcl
  27.  
  28. #
  29. # Music
  30. #
  31. if [file exists $cup_dir/music.tcl] {
  32.     source $cup_dir/music.tcl
  33. } else {
  34.     select_racing_music 1
  35. }
  36.  
  37. source procs.tcl
  38.  
  39. source sounds.tcl
  40.  
  41. objcall :servers:render set_loading_text [ gs loading_terrain_textures]
  42. source terrain_textures.tcl
  43.  
  44. objcall :servers:render set_loading_text [ gs loading_terrains]
  45. source terrains.tcl
  46.  
  47. objcall :servers:render set_loading_text [ gs loading_object_textures]
  48. source object_textures.tcl
  49.  
  50. objcall :servers:render set_loading_text [ gs loading_objects]
  51. source objects.tcl
  52.  
  53. objcall :servers:render set_loading_text [ gs loading_terrain_map]
  54.  
  55. objcall :course:heightmap load_terrain "$cwd/terrain.png"
  56.  
  57. objcall :servers:render set_loading_text [ gs placing_objects]
  58.  
  59. cd $cwd
  60.  
  61. if [file exists "items.tcl"] {
  62.     source "items.tcl"
  63. }
  64.